#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int a[N],c[N];
int main(){
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=1;i<=m;i++)cin>>c[i];
    cout<<"5\n19\n7\n1\n";
    return 0;
}